package com.xinsmartsky.penmaji.penmaji;

import java.util.Timer;
import java.util.TimerTask;

/**
 * Created by wangxiao on 16-1-30.
 */
public class DemoThread2 {
    private Object obj = null;

    public DemoThread2(Object obj) {
        this.obj = obj;
    }

    public void starts() {
        Timer timer = new Timer();
        timer.schedule(new TimerTask() {
            @Override
            public void run() {
                synchronized (obj) {
                    obj.notify();
                }
            }
        }, 1000, 1000);
    }
}
